package com.example.message.listener;

import com.example.message.config.MessageQueue;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * Author:   dgc
 * Date:     2020/8/12 15:53
 */
@Component
@Slf4j
public class DelayMessageListener {

    @RabbitListener(queues = MessageQueue.ROUTINGKEY1)
    public void processMessage(byte[] content) {
        byte[] body = content;
        String time = new Date().toString();
        log.info("notify-message1-h5 收到消息 : " + new String(body)+" 时间："+time);
    }
}
